import time,os,sys,pytest
sys.path.append(os.getcwd())

from utils.init_driver import init_driver #初始化driver
from utils.readConfig import readConfig #读取配置工具类
from utils.readYamlUtils import yaml_data_with_file #导入读取测试数据的工具类
from service.service_form import ServiceForm


class TestForm(object):
    def setup_class(self):
        self.base_url = readConfig("config/webSiteConfig.yaml")["base_url"]  # "http://shop.aircheng.com/"

    def teardown_class(self):
        pass

    def setup(self):
        # 初始化driver
        self.driver = init_driver(timeout=10)
        # 初始化业务对象
        self.service = ServiceForm(self.driver, self.base_url)

    def teardown(self):
        time.sleep(5)
        self.driver.quit()  # 关闭并退出浏览器


    def test_form_001(self):
        assert self.service.service_form_001()